package com.coupon.mapper;

import com.coupon.pojo.*;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @author :wn
 */
@SuppressWarnings("all")
public interface UserMapper {

    User  selectById(Integer id);
    /**
     *@Description:
     *@Param: [id]
     *@return: com.coupon.pojo.User
     *@date: 2020/12/28
     */
    User selectByPhone(String phone
    /**
    *@Description:
    *@Param: [phone]
    *@return: com.coupon.pojo.User
    *@date: 2020/12/29
    */
    );

    int deleteByPhone(String phone
    /**
    *@Description:
    *@Param: [phone]
    *@return: int
    *@date: 2020/12/29
    */
    );

    int addUser(User user
    /**
    *@Description:
    *@Param: [user]
    *@return: int
    *@date: 2020/12/29
    */
    );

    int updateUser(User user
    /**
    *@Description:
    *@Param: [user]
    *@return: int
    *@date: 2020/12/29
    */
    );
    List<User> selectAll(Integer offset,String name);
    @Select("  select count(*)\n" +
            "        from tb_user;")
    int selectCount();
    List<User> selectAllNoArgs();
    int getCoupon(UserGet userGet);
    /*Integer offset,String phone)*/

    int selectUserGetCount();

    List<ExchangeCoupon> selectUsedCoupon(String   from,String   to);




    List<Coupon> selectNotGet(String phone,String date);
    List<Coupon> selectHadGet(String phone,String date);
    List<Coupon> selectOutTime(String phone,String date);
    int writeOff(int cpId ,String phone);

    //CoupList
    int selectAllUserGetCount();
    List<CouponList> selectHadArg(Integer offset,String phone);
    List<CouponList> selectAllUserGet();

    List<UserGet> UserGetCpnAll(String phone);

    List<UserGet> overExpire(String phone);

    List<ExchangeCoupon> selectChangeList(Integer offset,String from ,String to);


List<User> selectTestALl();

}
